package viroyal.com.base.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

import org.kymjs.kjframe.database.annotate.Id;
import org.kymjs.kjframe.database.annotate.Property;
import org.kymjs.kjframe.database.annotate.Table;


/**
 * @author chenjunwei
 * @desc
 * @date 2019/4/28
 */
@Table(name = "style")
public class OwnStyle implements Parcelable {
  @Id(column = "id", autoInc = true)
  public int id;

  @SerializedName("bottom_bg")
  @Property(column = "bottom_bg")
  public String bottom_bg;
  @SerializedName("code_url")
  @Property(column = "code_url")
  public String code_url;
  @SerializedName("head_bg")
  @Property(column = "head_bg")
  public String head_bg;
  @SerializedName("head_url")
  @Property(column = "head_url")
  public String head_url;
  @SerializedName("min_bg")
  @Property(column = "mid_bg")
  public String mid_bg;
  @SerializedName("show_photo")
  @Property(column = "show_photo")
  public int show_photo;
  @SerializedName("photograph")
  @Property(column = "photograph")
  public int photograph;
  @SerializedName("announce")
  @Property(column = "announce")
  public int announce;

  @SerializedName("swipe_interval_time")
  @Property(column = "swipe_interval_time")
  public String swipe_interval_time;

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeInt(this.id);
    dest.writeString(this.bottom_bg);
    dest.writeString(this.code_url);
    dest.writeString(this.head_bg);
    dest.writeString(this.head_url);
    dest.writeString(this.mid_bg);
    dest.writeInt(this.photograph);
    dest.writeInt(this.announce);
    dest.writeInt(this.show_photo);
  }

  public OwnStyle() {
  }

  protected OwnStyle(Parcel in) {
    this.id = in.readInt();
    this.show_photo = in.readInt();
    this.photograph = in.readInt();
    this.bottom_bg = in.readString();
    this.code_url = in.readString();
    this.head_bg = in.readString();
    this.head_url = in.readString();
    this.mid_bg = in.readString();
    this.announce = in.readInt();
  }

  public static final Parcelable.Creator<OwnStyle> CREATOR = new Parcelable.Creator<OwnStyle>() {
    @Override
    public OwnStyle createFromParcel(Parcel source) {
      return new OwnStyle(source);
    }

    @Override
    public OwnStyle[] newArray(int size) {
      return new OwnStyle[size];
    }
  };

}
